package com.turing.comment.mapper;

import com.turing.comment.entity.Comment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* @author admin
* @description 针对表【comment(评论)】的数据库操作Mapper
* @createDate 2023-05-08 14:29:25
* @Entity com.turing.comment.entity.Comment
*/
public interface CommentMapper extends BaseMapper<Comment> {

    List<LinkedHashMap<String, Object>> getCnList(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("merchantName") String merchantName, @Param("missionTitle") String missionTitle, @Param("cusNickname") String cusNickname, @Param("sortType") Integer sortType, @Param("orderType") Integer orderType, @Param("commentIds") List<String> commentIds);
//    List<LinkedHashMap<String, Object>> getCnList(@Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime, @Param("merchantName") String merchantName, @Param("missionTitle") String missionTitle, @Param("cusNickname") String cusNickname, @Param("sortType") Integer sortType, @Param("orderType") Integer orderType, @Param("commentIds") List<String> commentIds);

    LinkedHashMap<String, Object> getCnById(@Param("id") String id);

    LinkedHashMap<String, Object> geCnByIdForPhone(@Param("id") String id);

    List<Map> listLikeCount();

    Integer getCcIdByCommentAndCus(@Param("id") String id, @Param("cusId") String cusId);

//    Integer getMiCount(@Param("missionId") String missionId);

    Integer getMiCount(@Param("missionId") String missionId,@Param("cusId") String cusId);

    List<LinkedHashMap<String, Object>> getReplyList(@Param("id") String id);


    List<LinkedHashMap<String, Object>> dashCommentList(@Param("cityId") String cityId, @Param("sortType") Integer sortType, @Param("orderType") Integer orderType, @Param("commentIds") List<String> commentIds);

    Integer getLikeCount(@Param("id") String id);

    Integer getMerchantComments(@Param("id") String id);


    Integer getMyMiStateByMiId(@Param("missionId") String missionId, @Param("cusId") String cusId);

    Integer getSignState(@Param("missionId") String missionId, @Param("cusId") String cusId);

    Integer getReplyCount(@Param("id") String id);

    List<LinkedHashMap<String, Object>> getMessageList(@Param("id") String id);


    List<LinkedHashMap<String, Object>> dashAttCommentList(@Param("cityId") String cityId, @Param("sortType") Integer sortType, @Param("orderType") Integer orderType, @Param("commentIds") List<String> commentIds, @Param("attCusId") String attCusId,@Param("comList") List<String> comList);

    List<String> getAttCusId(@Param("cusId") String cusId);

    List<LinkedHashMap> dashAttComList(@Param("cityId") String cityId, @Param("sortType") Integer sortType, @Param("orderType") Integer orderType, @Param("cusId") String cusId, @Param("attComments") Set attComments);

    List<LinkedHashMap> dashComList(@Param("cityId") String cityId, @Param("sortType") Integer sortType, @Param("orderType") Integer orderType, @Param("attCusIds") List attCusIds);

    List<String> dashComIdsList(@Param("cityId") String cityId, @Param("sortType") Integer sortType, @Param("orderType") Integer orderType, @Param("attCusIds") List attCusIds);

    List<LinkedHashMap> listByLikeCount(List<String> resultCommentIdList, Integer orderType);
}




